<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
//var a=[[1,2,3],[4,5,6],[7,8,9]];
  /*var a=[[1,2,3],[3,5,6],[7,4,5],[9,5,8]];
		for(var i in a){
		for(var x of a[i]){
			document.write(x+" ");
		}
		    document.write("</br>");
	}
*/
	var arr=[[1,2,3],[3,5,6],[7,4,5],[9,5,8]];
	var res=[];
	var childArr=[];
	for(var j in arr[0]){
		childArr=[]; //把之前的数组清空
		for(var i in arr){
		    childArr.push(arr[i][j]);
	}
	        res.push(childArr);
    }
	
	/*for(var i in arr){
		childArr.push(arr[i][0]);	
		
	}
	res.push(childArr);
	childArr=[];
	for(var i in arr){
		childArr.push(arr[i][1]);
	}
	res.push(childArr);
	childArr=[];
	for(var i in arr){
		childArr.push(arr[i][2])
	}
	*/

	 for (var x of res){
		 document.write(x+"</br>");
	 }

</script>
</body>
</html>
